<div class="col-lg-3" style="overflow-y:auto;">
	<div class="row" style="padding:5px;">
		<div class="col-lg-12" >
			<ul class="ukefu-contacts-menu">
				<li class="menu-dropdown">
					<a class="menu-dropdown-a" href="javascript:void(0);"> 
						<i class="layui-icon "></i> 
						<span class="text">公共联系人</span>
					</a>
					<i class="layui-icon " style="float:right;text-indent: 2em;"></i> 
					<div class="list page-list" <#if !ckind??> style="display: none;"</#if>>
						<div class="list-con crm-clearfix">
							<ul class="list-menu">
								<#if user?? && (user.roleAuthMap["A02_A01_A01"]?? || user.usertype == "0") >
									<li>
										<a <#if !ckind?? && !itemid??>class="cur"</#if> href="/apps/contacts/contactslist.html?contactsid=${contactsid!''}&" data-toggle="load" data-target="#contactlist" style="text-indent: 2em;">
											<i class="layui-icon"></i> 
											<span class="text">全部联系人</span>
										</a>
									</li>
								</#if>
								<#if user?? && (user.roleAuthMap["A02_A01_A02"]?? || user.usertype == "0") >
								<#if uKeFuDic['com.dic.contacts.ckind']??>
								<#list uKeFuDic['com.dic.contacts.ckind'] as dic>
									<li>
										<a <#if ckind?? && ckind==dic.id>class="cur"</#if>  href="/apps/contacts/contactslist.html?contactsid=${contactsid!''}&ckind=${dic.id!''}" data-toggle="load" data-target="#contactlist" style="text-indent: 2em;">
											<i class="layui-icon">&#xe770;</i> 
											<span class="text">${dic.name!''}</span>
										</a>
									</li>
								</#list>
								</#if>
								</#if>
							</ul>
						</div>
					</div>
				</li>
			
				
				<#if contactsItemList?? && contactsItemList?size gt 0>
					<#list contactsItemList as contactsItem>
						<#if contactsItem.itemid?? && contactsItem.itemid==contactsItem.id>
							<li class="menu-dropdown">
								<a class="menu-dropdown-a" href="javascript:void(0)"> 
									<i class="layui-icon ">&#xe613;</i> 
									<span class="text">${contactsItem.name!''}</span>
								</a>
								<#list contactsItemList as item2>
									<#if item2.parentid?? && item2.parentid==contactsItem.id>
									<i class="layui-icon <#list contactsItemList as item2><#if item2.parentid?? && item2.parentid==contactsItem.id>menu-dropdown-a</#if><#break></#list>" style="float:right;text-indent: 2em;"></i> 
									<div class="list page-list" style="">
										<div class="list-con crm-clearfix">
											<ul class="list-menu">
												<#list contactsItemList as itemtype>
													<#if itemtype.parentid?? && itemtype.parentid==contactsItem.id>
														<li>
														<a <#if itemid?? && itemid==itemtype.id>class="cur"</#if>  href="/apps/contacts/contactslist.html?contactsid=${contactsid!''}&itemid=${itemtype.id!''}" style="text-indent: 2em;" data-toggle="load" data-target="#contactlist">
															<i class="layui-icon">&#xe770;</i> 
															<span class="text">${itemtype.name!''}</span>
														</a>
														</li>
													</#if>
												</#list>
											</ul>
										</div>
									</div>
									<#break>
									</#if>
								</#list>
							</li>
						</#if>
					</#list>
				</#if>
			</ul>
		</div>
	</div>
</div>
<div class="col-lg-9" style="border-left:1px solid #dedede;">
	<div class="box">
		<div class="box-body" style="padding:0px 2px;position: relative;height:434px;overflow-y:auto;" id="AgentList">
			<div class="usertablelist">
				<div class="col-lg-12">
					<table class="layui-table" lay-skin="line">
						<thead>
							<tr class="design-sortable-tr">
								<th>
									选择
								</th>
								<th>联系人姓名</th>
								<th>手机</th>
								<th>邮件</th>
								<th>性别</th>
							</tr>
						</thead>
						<tbody>
							<#if contactsList?? && contactsList.content?? && contactsList.content?size gt 0>
							<#list contactsList.content as contacts>
							<#if contactsid?? && contacts.id!=contactsid>
							<tr class="tdHasContorllor design-dropable-td">
								<td style="width:1%;">
									<input type="radio" class="ids" name="relateid" value="${contacts.id!''}"/>
								</td>
								<td >
									<a href="javascript:void(0)" onclick="return false;" data-toggle="tab" data-title="<#if contacts?? && contacts.ctype=='contacts'>联系人<#elseif contacts?? && contacts.ctype=='customer'>客户</#if>（${contacts.name!''}）" data-href="/apps/contacts/view.html?id=${contacts.id!''}"  data-id="contacts${contacts.id!''}" data-type="tabAdd">
										<i class="layui-icon headimg">&#xe612;</i>
										<div style="margin-left:50px;margin-top:9px;">
											${contacts.name!''}
										</div>
										<div title="动态" style="margin-left:50px;margin-top:0px;color:#cccccc;font-size:13px;position: absolute;width: 800px;">
											${contacts.memo!''}
										</div>
									</a>
								</td>
								<td>
									<span class="ukefu-phone-number">
									${contacts.mobileno!''} 
									</span>
								</td>
								<td>
									${contacts.email!''} 
								</td>
								<td>
									<#if contacts.gender?? && contacts.gender == '1'>男</#if>
									<#if contacts.gender?? && contacts.gender == '0'>女</#if>
									<#if contacts.gender?? && contacts.gender == '-1'>未知</#if>
								</td>
							</tr>
							</#if>
							</#list>
							<#else>
								<tr>
									<td colspan="20" style="height:400px;">
										<div class="ukefu-empty">
											<i class="layui-icon">&#xe63a;</i>
											<div style="">还没有联系人信息</div>
										</div>
									</td>
								</tr>
							</#if>
						</tbody>
					</table>
				</div> 	   
				<div class="row" style="padding:5px;">
					<div class="col-lg-12" id="page" style="text-align:center;"></div>
				</div>
			</div>
		</div>
	</div>
</div>




<script>
$(document).ready(function(){
	$(".menu-dropdown-a").click(function(){
		  var objpage = $(this).parent().children(".page-list") ;
		  if(objpage.css("display")=="none"){
			  objpage.show();
		  }else{
			  objpage.hide();
		  }
	});
})
layui.use('form', function() {
	var form = layui.form;
	form.render(); //更新全部
});
layui.use(['laypage', 'layer'], function(){
	  var laypage = layui.laypage
	  ,layer = layui.layer;
	  
	  laypage.render({
			elem: 'page'
			,pages: <#if contactsList??>${contactsList.totalPages}<#else>0</#if> //总页数
			,curr:<#if contactsList??>${contactsList.number+1}<#else>0</#if>
			,groups: 5 //连续显示分页数
			,jump:function(data , first){
				if(!first){
					loadURL("/apps/contacts/contactslist.html?p="+data.curr+"&itemid=${itemid!''}&ckind=${ckind!''}","#contactlist");
				}
			}
	   });
	});
</script>